package edu.hut.bookshop.dao;

import edu.hut.bookshop.pojo.Order;

import java.util.List;

public interface OrderMapper {
    int deleteByOrderId(Integer orderId);

    int insert(Order record);

    Order selectByOrderId(Integer orderId);

    int updateByOrderId(Order record);

    List<Order> selectAll();

    /**
     * 根据用户id查询订单
     * @param userId
     * @return
     */
    List<Order> selectByUserId(Integer userId);

    List<Order> searchOrders(Order order);

    /**
     * 通过商家名来查找订单
     * @param
     * @return
     */
    List<Order> searchOrdersbybName(String bName);

    List<Integer> selectorderIdsByUserId(Integer userId);

    /**
     * 更改状态
     * @return
     */
    int updatestatus(Integer orderId);

    /**修改状态
     *
     */
    int updateisdelete(Integer orderId,Integer isDelete);
}